import { Injectable } from '@angular/core'
import { HttpClientService } from 'src/app/common/httpClient/http'

@Injectable({
  providedIn: 'root'
})
export class MineService {
  list = [
    {
      name: 'first',
      children: [
        {
          alias: 'appoint',
          name: '我的预约',
          value: '',
          icon: 'icon_book'
        },
        {
          alias: 'enroll',
          name: '我的报名',
          value: '',
          icon: 'icon_enrolment'
        },
        {
          alias: 'qa',
          name: '我的问答',
          value: '',
          icon: 'icon_question'
        },
        {
          alias: 'comment',
          name: '我的点评',
          value: '',
          icon: 'icon_comment'
        },
        {
          alias: 'footprint',
          name: '我的足迹',
          value: '',
          icon: 'icon_history'
        }
      ]
    },
    {
      name: 'second',
      children: [
        {
          alias: 'houseLoan',
          name: '房贷计算器',
          value: '',
          icon: 'icon_mortgage'
        },
        // {
        //   alias: 'taxation',
        //   name: '税费计算器',
        //   value: '',
        //   icon: 'icon_taxation'
        // }
      ]
    }
  ]
  constructor(private http: HttpClientService) {}

  // 获取个人中心列表
  getEntryList() {
    return this.list
  }
  // 获取用户资料
  getCurrentUser(callback, errorBack?) {
    this.http.post({}, '/Platform/Json/UserService.svc/GetCurrentUser', callback, errorBack)
  }
  // 编辑个人信息
  modifyCurrentUser(reqdata, callback, errorBack?) {
    this.http.post(reqdata, '/Platform/Json/UserService.svc/Complete', callback, errorBack)
  }
}
